let vm = new Vue({
    el: '.main-content',
    data: {
        demandInfo: {}
    },
    methods: {
        findById:function (id) {
            axios.get('/guguanjia/demand/get?id='+id).then(function (resp) {
                vm.$data.demandInfo = resp.data;
            });
        },

        doUpdate:function (demandInfo) {
            axios({
                url: "/guguanjia/demand/updateById",
                method: "POST",
                data: demandInfo,
            }).then(response=>{
                let index = parent.layer.getFrameIndex(window.name);

                parent.layer.close(index)
            }).catch(error=>{
                layer.msg(error.message)
            })
        },
        cancel:function () {
            let index = parent.layer.getFrameIndex(window.name);

            parent.layer.close(index)
        }

    }
});
function child(data,index) {
    vm.findById(data);
}